package com.miplus.ccrm.core.controller;

import com.miplus.ccrm.common.CmdResVo;
import com.miplus.ccrm.common.PageData;
import com.miplus.ccrm.common.R;
import com.miplus.ccrm.core.controller.vo.LabelResVo;
import com.miplus.ccrm.core.controller.vo.conf.NamesResVo;
import com.miplus.ccrm.core.controller.vo.strategy.*;
import com.miplus.ccrm.core.mapper.CfgAssignsetMapper;
import com.miplus.ccrm.core.pojo.*;
import com.miplus.ccrm.core.security.JCommonData;
import com.miplus.ccrm.core.service.strategy.*;
import com.miplus.ccrm.core.service.utils.LogXxlJobService;
import com.miplus.ccrm.core.utils.SpringContextUtil;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 2-3.任务策略管理服务接口
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/cpg")
public class StraController {
    @Resource
    private CpCalllistService cpCalllistService;
    @Resource
    private CpStrategyService cpStrategyService;
    @Resource
    private CpCalllistTriggerService cpCalllistTriggerService;
    @Resource
    private CpCalllistTriggerQuerylinkService cpCalllistTriggerQuerylinkService;
    @Resource
    private CfgActivityService cfgActivityService;
    @Resource
    private CfgActivityQuerylinkService cfgActivityQuerylinkService;
    @Resource
    private CfgActivityQuerydatacolService cfgActivityQuerydatacolService;
    @Resource
    private CfgAssignsetService cfgAssignsetService;

    @Resource
    private CfgRuleVarsService cfgRuleVarsService;

    @Resource
    private CfgRuleTaskService cfgRuleTaskService;

    @Resource
    private CfgRuleTaskStepsService cfgRuleTaskStepsService;

    @Resource
    private LogXxlJobService logXxlJobService;

    @Resource
    private JCommonData jCommonData;

    /**
     * 取案件任务LIST
     */
    @GetMapping("/campaignList")
    public R<PageData<CpListResVo>> campaignList(@Validated CpListReqVo cpListReqVo){
        return R.SuccessPage(cpCalllistService.campaignList(cpListReqVo));
    }

    /**
     * 添加案件任务
     */
    @PostMapping("/campaignInsert")
    public R<CmdResVo> campaignInsert(@RequestBody @Validated CpListEditVo cpListEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cpCalllistService.campaignInsert(usrid,cpListEditVo));
    }

    /**
     * 修改案件任务
     */
    @PostMapping("/campaignUpdate")
    public R<CmdResVo> campaignUpdate(@RequestBody @Validated CpListEditVo cpListEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cpCalllistService.campaignUpdate(usrid,cpListEditVo));
    }

    /**
     * 删除案件任务
     */
    @PostMapping("/campaignDelete")
    public R<CmdResVo> campaignDelete(@RequestBody @Validated CpListIDVo cpListIDVo) {
        return R.Success(cpCalllistService.campaignDelete(cpListIDVo.getClid()));
    }

    /**
     * 取案件任务ID.LIST
     */
    @GetMapping("/campaignSelectList")
    public R<List<LabelResVo>> campaignSelectList(){
        return R.Success(cpCalllistService.campaignSelectList());
    }

    /**
     * 取质检任务ID.LIST
     * 不加@RequestParam参数，表示非必传
     */
    @GetMapping("/qmSelectList")
    public R<List<LabelResVo>> qmSelectList(Integer status){
        return R.Success(cpCalllistService.qmSelectList(status));
    }

    /**
     * 取任务策略LIST
     */
    @GetMapping("/strategyList")
    public R<PageData<StrategyResVo>> strategyList(@Validated StrategyReqVo strategyReqVo){
        return R.SuccessPage(cpStrategyService.strategyList(strategyReqVo));
    }

    /**
     * 取任务策略ID.LIST
     */
    @GetMapping("/contactResults")
    public R<List<LabelResVo>> contactResults(@RequestParam @NotNull String clid){
        return R.Success(cpStrategyService.contactResults(clid));
    }

    /**
     * 添加任务策略
     */
    @PostMapping("/strategyInsert")
    public R<CmdResVo> strategyInsert(@RequestBody @Validated StrategyEditVo strategyEditVo) {
        return R.Success(cpStrategyService.strategyInsert(strategyEditVo));
    }

    /**
     * 修改任务策略
     */
    @PostMapping("/strategyUpdate")
    public R<CmdResVo> cstrategyUpdate(@RequestBody @Validated StrategyEditVo strategyEditVo) {
        return R.Success(cpStrategyService.strategyUpdate(strategyEditVo));
    }

    /**
     * 删除任务策略
     */
    @PostMapping("/strategyDelete")
    public R<CmdResVo> strategyDelete(@RequestBody @Validated StrategyIDVo strategyIDVo) {
        return R.Success(cpStrategyService.strategyDelete(strategyIDVo.getStrategyid()));
    }

    /**
     * 取任务触发器详细信息LIST
     */
    @GetMapping("/triggerList")
    public R<PageData<TriggerResVo>> triggerList(@Validated TriggerReqVo triggerReqVo){
        return R.SuccessPage(cpCalllistTriggerService.triggerList(triggerReqVo));
    }

    /**
     * 取任务触发器Value LIST
     */
    @GetMapping("/getTriggerList")
    public R<List<LabelResVo>> getTriggerList(){
        return R.Success(cpCalllistTriggerService.getTriggerList());
    }

    /**
     * 添加任务触发器
     */
    @PostMapping("/triggerInsert")
    public R<CmdResVo> triggerInsert(@RequestBody @Validated TriggerEditVo triggerEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cpCalllistTriggerService.triggerInsert(usrid,triggerEditVo));
    }

    /**
     * 修改任务触发器
     */
    @PostMapping("/triggerUpdate")
    public R<CmdResVo> triggerUpdate(@RequestBody @Validated TriggerEditVo triggerEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cpCalllistTriggerService.triggerUpdate(usrid,triggerEditVo));
    }

    /**
     * 删除任务触发器
     */
    @PostMapping("/triggerDelete")
    public R<CmdResVo> triggerDelete(@RequestBody @Validated TriggerIDVo triggerIDVo) {
        return R.Success(cpCalllistTriggerService.triggerDelete(triggerIDVo.getTriggerid()));
    }

    /**
     * 取触发器筛选目标LIST
     */
    @GetMapping("/triggerColList")
    public R<List<LabelResVo>> triggerColList(){
        return R.Success(cfgActivityQuerydatacolService.triggerColList());
    }

    /**
     * 取触发器对应规则LIST
     */
    @GetMapping("/triggerRuleList")
    public R<PageData<TriglinkResVo>> queryRuleListTrigger(@Validated TriglinkReqVo triglinkReqVo){
        return R.SuccessPage(cpCalllistTriggerQuerylinkService.queryRuleListTrigger(triglinkReqVo));
    }

    /**
     * 添加任务触发器规则
     */
    @PostMapping("/triggerRuleInsert")
    public R<CmdResVo> insertRuleListTrigger(@RequestBody @Validated TriglinkEditVo triglinkEditVo) {
        return R.Success(cpCalllistTriggerQuerylinkService.insertQueryRuleTrigger(triglinkEditVo));
    }

    /**
     * 修改任务触发器规则
     */
    @PostMapping("/triggerRuleUpdate")
    public R<CmdResVo> updateQueryRuleTrigger(@RequestBody @Validated TriglinkEditVo triglinkEditVo) {
        return R.Success(cpCalllistTriggerQuerylinkService.updateQueryRuleTrigger(triglinkEditVo));
    }

    /**
     * 删除任务触发器规则
     */
    @PostMapping("/triggerRuleDelete")
    public R<CmdResVo> deleteQueryRuleTrigger(@RequestBody @Validated TriglinkIDVo triglinkIDVo) {
        return R.Success(cpCalllistTriggerQuerylinkService.deleteQueryRuleTrigger(triglinkIDVo.getQueryruleid()));
    }

    /**
     * 取自动分案模板LIST
     */
    @GetMapping("/cfgActivityList")
    public R<PageData<ActivityResVo>> cfgActivityList(@Validated ActivityReqVo activityReqVo){
        return R.SuccessPage(cfgActivityService.cfgActivityList(activityReqVo));
    }


    /**
     * 添加自动分案模板
     */
    @PostMapping("/cfgActivityInsert")
    public R<CmdResVo> cfgActivityInsert(@RequestBody @Validated ActivityEditVo activityEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cfgActivityService.cfgActivityInsert(usrid,activityEditVo));
    }

    /**
     * 修改自动分案模板
     */
    @PostMapping("/cfgActivityUpdate")
    public R<CmdResVo> cfgActivityUpdate(@RequestBody @Validated ActivityEditVo activityEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cfgActivityService.cfgActivityUpdate(usrid,activityEditVo));
    }

    /**
     * 删除自动分案模板
     */
    @PostMapping("/cfgActivityDelete")
    public R<CmdResVo> cfgActivityDelete(@RequestBody @Validated ActivityIDVo activityIDVo) {
        return R.Success(cfgActivityService.cfgActivityDelete(activityIDVo.getActivityid()));
    }

    /**
     * 自动分案模板上移
     */
    @PostMapping("/upCfgActivity")
    public R<CmdResVo> upCfgActivity(@RequestBody @Validated ActivityIDVo activityIDVo) {
        return R.Success(cfgActivityService.upCfgActivity(activityIDVo.getActivityid()));
    }

    /**
     * 自动分案模板下移
     */
    @PostMapping("/downCfgActivity")
    public R<CmdResVo> downCfgActivity(@RequestBody @Validated ActivityIDVo activityIDVo) {
        return R.Success(cfgActivityService.downCfgActivity(activityIDVo.getActivityid()));
    }

    /**
     * 自动分案模板规则LIST
     */
    @GetMapping("/activityRuleList")
    public R<PageData<ActRuleResVo>> activityRuleList(@Validated ActRuleReqVo actRuleReqVo){
        return R.SuccessPage(cfgActivityQuerylinkService.activityRuleList(actRuleReqVo));
    }

    /**
     * 添加自动分案模板规则
     */
    @PostMapping("/activityRuleInsert")
    public R<CmdResVo> activityRuleInsert(@RequestBody @Validated ActRuleEditVo actRuleEditVo) {
        return R.Success(cfgActivityQuerylinkService.activityRuleInsert(actRuleEditVo));
    }

    /**
     * 修改自动分案模板规则
     */
    @PostMapping("/activityRuleUpdate")
    public R<CmdResVo> activityRuleUpdate(@RequestBody @Validated ActRuleEditVo actRuleEditVo) {
        return R.Success(cfgActivityQuerylinkService.activityRuleUpdate(actRuleEditVo));
    }

    /**
     * 删除自动分案模板规则
     */
    @PostMapping("/activityRuleDelete")
    public R<CmdResVo> activityRuleDelete(@RequestBody @Validated ActRuleIDVo actRuleIDVo) {
        return R.Success(cfgActivityQuerylinkService.activityRuleDelete(actRuleIDVo.getQueryruleid()));
    }

    /**
     * 自动分案模板关联组或机构信息LIST
     */
    @GetMapping("/activityGroupList")
    public R<PageData<ActOGrpLinkResVo>> activityGroupList(@Validated ActOGrpLinkReqVo actOGrpLinkReqVo){
        return R.SuccessPage(cfgActivityService.activityOutGrpList(actOGrpLinkReqVo));
    }

    /**
     * 取自动分案模板对应执行日List
     */
    @GetMapping("/getActivityExecDayList")
    public R<List<ActExecDayVo>> getActivityExecDayList(@Validated Integer activityId){
        return R.Success(cfgActivityService.getActivityExecDay(activityId));
    }

    /**
     * 自动派工模板规则LIST
     */
    @GetMapping("/assignSetList")
    public R<PageData<AssSetResVo>> assignSetList(@Validated AssSetReqVo assSetReqVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.SuccessPage(cfgAssignsetService.assignSetList(usrid,assSetReqVo));
    }

    /**
     * 添加自动派工模板规则
     */
    @PostMapping("/assignSetInsert")
    public R<CmdResVo> assignSetInsert(@RequestBody @Validated AssSetEditVo assSetEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cfgAssignsetService.assignSetInsert(usrid,assSetEditVo));
    }

    /**
     * 修改自动派工模板规则
     */
    @PostMapping("/assignSetUpdate")
    public R<CmdResVo> assignSetUpdate(@RequestBody @Validated AssSetEditVo assSetEditVo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cfgAssignsetService.assignSetUpdate(usrid,assSetEditVo));
    }

    /**
     * 删除自动派工模板规则
     */
    @PostMapping("/assignSetDelete")
    public R<CmdResVo> assignSetDelete(@RequestBody @Validated AssSetDelVo assSetDelVo) {
        return R.Success(cfgAssignsetService.assignSetDelete(assSetDelVo.getAssignId()));
    }

    /**
     * 取自动派工催员信息GRID
     */
    @GetMapping("/assignRatioGrid")
    public R<List<AssRatioResVo>> assignRatioGrid(@RequestParam @NotNull String grpid, Long assignId){
        return R.Success(cfgAssignsetService.assignRatioList(grpid, assignId));
    }
    /**
     * 取自动派工催员信息GRID
     */
    @PostMapping("/assignRatioGrid")
    public R<List<AssRatioResVo>> assignRatioGrid2(@RequestBody @Validated AssRatioReqVo assRatioReqVo){
        return R.Success(cfgAssignsetService.assignRatioList2(assRatioReqVo));
    }
    /**
     * 获取参数列表
     * varGrp：参数分类标识。字典：RULE.VARGRP
     */
    @GetMapping("/getRuleVarList")
    public R<List<RuleVarsListResVo>> getRuleVarList(@RequestParam String varGrp){
        return R.Success(cfgRuleVarsService.getRuleVarsList(varGrp));
    }

    /**
     * 获取参数列表 （分页显示）    *
     */
    @PostMapping("/getRuleVarPageList")
    public R<PageData<RuleVarsListResVo>> getRuleVarPageList(@RequestBody @Validated RuleVarListReqVo ruleVarsListReqVo){

        return R.SuccessPage(cfgRuleVarsService.getRuleVarPageList(ruleVarsListReqVo));
    }
    /**
     * 获取参数详情
     * varId：参数ID
     */
    @GetMapping("/getRuleVarInfo")
    public R<RuleVarsListResVo> getRuleVarInfo(@RequestParam @NotNull Long varId){
        return R.Success(cfgRuleVarsService.getRuleVar(varId));
    }

    /**
     * 获取参数选项值
     * varId：参数ID
     */
    @GetMapping("/getRuleVarSelectOption")
    public R<List<NamesResVo>> getRuleVarSelectOption(@RequestParam @NotNull Long varId){
        return R.Success(cfgRuleVarsService.getRuleVarSelectOption(varId));
    }

    /**
     * 增加参数定义
     */
    @PostMapping("/addRuleVar")
    public R<CmdResVo> addRuleVar(@RequestBody @Validated CfgRuleVars vo) {
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleVarsService.addRuleVar(usrid,vo));
    }
    /**
     * 修改参数定义
     */
    @PostMapping("/updateRuleVar")
    public R<CmdResVo> updateRuleVar(@RequestBody @Validated CfgRuleVars vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleVarsService.updateRuleVar(usrId,vo));
    }

    /**
     * 删除参数定义
     */
    @PostMapping("/deleteRuleVar")
    public R<CmdResVo> deleteRuleVar(@RequestBody @Validated CfgRuleVars vo) {

        return R.Success(cfgRuleVarsService.deleteRuleVar(vo.getVarId()));
    }

    /**
     * 决策树任务列表
     */
    @GetMapping("/getRuleTaskList")
    public R<PageData<RuleTaskListResVo>> getRuleTaskList(@Validated RuleTaskReqVo ruleTaskReqVo){
        String usrId = jCommonData.getCurrUsrID();
        return R.SuccessPage(cfgRuleTaskService.getRuleTaskList(usrId, ruleTaskReqVo));
    }

    /**
     * 决策树任务列表
     */
    @GetMapping("/getRuleTaskInfo")
    public R<RuleTaskListResVo> getRuleTaskInfo(@Validated Long ruleTaskId){
        return R.Success(cfgRuleTaskService.getRuleTaskInfo(ruleTaskId));
    }

    /**
     * 决策树策略列表
     */
    @GetMapping("/getRuleTaskStepList")
    public R<PageData<RuleStepListResVo>> getRuleTaskStepList(@Validated Integer pageNum, Integer pageSize, Long ruleTaskId){

        return R.SuccessPage(cfgRuleTaskService.getRuleTaskStepList(pageNum, pageSize, ruleTaskId));
    }

    /**
     * 增加决策任务树
     */
    @PostMapping("/addRuleTask")
    public R<CmdResVo> addRuleTask(@RequestBody @Validated CfgRuleTask vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.addRuleTask(usrId,vo));
    }
    /**
     * 修改决策任务树
     */
    @PostMapping("/updateRuleTask")
    public R<CmdResVo> updateRuleTask(@RequestBody @Validated CfgRuleTask vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.updateRuleTask(usrId,vo));
    }

    /**
     * 删除决策数
     */
    @PostMapping("/deleteRuleTask")
    public R<CmdResVo> deleteRuleTask(@RequestBody @Validated CfgRuleTask vo) {

        return R.Success(cfgRuleTaskService.deleteRuleTask(vo.getRuleTaskId()));
    }


    /**
     * 重置任务运行状态。
     */
    @PostMapping("/resetRuleTask")
    public R<CmdResVo> resetRuleTask(@RequestBody @Validated CfgRuleTask vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.resetRuleTask(usrId,vo.getRuleTaskId()));
    }
    /**
     * 删除决策任务中的策略。
     */
    @PostMapping("/removeTaskStep")
    public R<CmdResVo> removeTaskStep(@RequestBody @Validated CfgRuleTaskStepLink cfgRuleTaskStepLink ) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.removeTaskStep(usrId, cfgRuleTaskStepLink.getRuleTaskId(), cfgRuleTaskStepLink.getRuleStepId()));
    }

    /**
     * 向任务决策树中增加策略。
     */
    @PostMapping("/addTaskStep")
    public R<CmdResVo> addTaskStep(@RequestBody @Validated RuleTaskStepLinkReqVo  ruleTaskStepLinkReqVo ) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.addTaskStep(usrId, ruleTaskStepLinkReqVo));
    }

    /**
     * 调整策略位置。
     * ruleTaskId:决策任务ID
     * ruleStepId：策略ID
     * UpOrDown：调节方式。Up：上调，Down：下调。
     */
    @PostMapping("/changeTaskStepSeq")
    public R<CmdResVo> changeTaskStepSeq(@RequestBody @Validated RuleStepPosChangeReqVo vo ) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.changeTaskStepSeq(usrId, vo.getRuleTaskId(), vo.getRuleStepId(), vo.getUpOrDown()));
    }

    /**
     * 策略列表查询（分页）
     */
    @PostMapping("/getRuleStepList")
    public R<PageData<RuleStepListResVo>> getRuleStepList(@RequestBody @Validated RuleStepListReqVo ruleStepListReqVo){
        String usrId= jCommonData.getCurrUsrID();
        return R.SuccessPage(cfgRuleTaskStepsService.getRuleStepList(usrId,ruleStepListReqVo));
    }
    /**
     * 策略列表查询 下拉选项
     */
    @GetMapping("/getRuleStepSelectList")
    public R<List<LabelResVo>> getRuleStepSelectList(@RequestParam("actionCode") Integer actionCode ){
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.getRuleStepSelectList(actionCode ));
    }


    /**
     * 获取策略详情
     */
    @GetMapping("/getRuleStepInfo")
    public R<RuleStepResVo> getRuleStepInfo(@Validated Long ruleStepId){
        return R.Success(cfgRuleTaskStepsService.getRuleStepInfo(ruleStepId));
    }

    /**
     * 获取策略条件列表
     */
    @GetMapping("/getRuleConditionList")
    public R<List<CfgRuleConditions>> getRuleConditionList(@Validated Long ruleStepId){
        return R.Success(cfgRuleTaskStepsService.getRuleConditionList(ruleStepId));
    }

    /**
     * 创建新策略。
     */
    @PostMapping("/addRuleStep")
    public R<CmdResVo> addRuleStep(@RequestBody @Validated RuleStepReqVo vo ) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.addRuleStep(usrId, vo));
    }

    /**
     * 更新策略。
     */
    @PostMapping("/updateRuleStep")
    public R<CmdResVo> updateRuleStep(@RequestBody @Validated RuleStepReqVo vo ) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.updateRuleStep(usrId, vo));
    }

    /**
     * 删除策略。
     */
    @PostMapping("/deleteRuleStep")
    public R<CmdResVo> deleteRuleStep(@RequestBody @Validated RuleStepReqVo vo ) {

        return R.Success(cfgRuleTaskStepsService.deleteRuleStep(vo.getRuleStepId()));
    }

    /**
     *  测试策略过滤器。
     */
    @PostMapping("/checkRuleStep")
    public R<CmdResVo> checkRuleStep(@RequestBody @Validated RuleStepReqVo vo ) {

        return R.Success(cfgRuleTaskStepsService.checkRuleStep(vo.getRuleStepId()));
    }

    /**
     * 手工执行策略。
     * ruleStepId：策略ID
     * isForceRun：是否强制执行，1：强制执行。
     */
    @PostMapping("/runRuleStep")
    public R<CmdResVo> runRuleStep(@RequestBody @Validated RuleStepRunReqVo vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.runRuleStep(usrId, vo.getRuleStepId(), vo.getIsForceRun()));
    }
    /**
     * 策略中增加条件。
     */
    @PostMapping("/addRuleCondition")
    public R<CmdResVo> addRuleCondition(@RequestBody @Validated  CfgRuleConditions cfgRuleConditions) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.addRuleCondition(usrId, cfgRuleConditions.getRuleStepId(), cfgRuleConditions));
    }

    /**
     * 更改策略中的条件。
     */
    @PostMapping("/updateRuleCondition")
    public R<CmdResVo> updateRuleCondition(@RequestBody @Validated CfgRuleConditions cfgRuleConditions) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.updateRuleCondition(usrId,cfgRuleConditions));
    }
    /**
     * 删除条件。
     */
    @PostMapping("/deleteRuleCondition")
    public R<CmdResVo> deleteRuleCondition(@RequestBody @Validated CfgRuleConditions vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskStepsService.deleteRuleCondition(usrId, vo.getConditionId()));
    }

    /**
     *  手工运行策任务树
     */
    @PostMapping("/executeRuleTask")
    public R<CmdResVo> executeRuleTask(@RequestBody @Validated CfgRuleTask vo) {
        String usrId= jCommonData.getCurrUsrID();
        return R.Success(cfgRuleTaskService.runTask(usrId,vo.getRuleTaskId(),1));
    }
    /**
     * 获取日志执行日志列表
     */
    @GetMapping("/getTasJobLog")
    public R<PageData<TaskLogResVo>> getTasJobLog(@Validated TaskLogReqVo taskLogReqVo){
        return R.SuccessPage(logXxlJobService.getTasJobLog(taskLogReqVo));
    }
}
